package sctu.edu.java.year2016.team08.chenruixiu.day20160604.chapter10_3;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Created by Administrator on 2016/6/6.
 */
public class MapText {
    public static void main(String[] args){
        Map<String,String> map=new HashMap<String,String>();
        Emp emp=new Emp("001","张三");
        Emp emp2=new Emp("005","李四");
        map.put(emp.getid(),emp.getname());
        map.put(emp2.getid(),emp2.getname());
        Set set =map.keySet();
        Iterator it=set.iterator();
        System.out.println("map集合的元素有：");
        while (it.hasNext()){
            String str=(String)it.next();
            String name=(String)map.get(str);
            System.out.println(str+""+name);

        }
        System.out.println (map);
        map.remove(emp2.getid());
        System.out.println (map);

    }
}
